package com.ceilcell.wx.atservice.service.impl;

import com.ceilcell.wx.atservice.mapper.AccessTokenMapper;
import com.ceilcell.wx.atservice.mapper.WeiXinServerIPMapper;
import com.ceilcell.wx.atservice.model.AccessToken;
import com.ceilcell.wx.atservice.model.WeiXinServerIP;
import com.ceilcell.wx.atservice.service.WeiXinServerIPService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

/**
 * Created by Administrator on 2017/4/23.
 */
@Service("weiXinServerIPService")
public class WeiXinServerIPServiceImpl implements WeiXinServerIPService {

    @Autowired
    WeiXinServerIPMapper weiXinServerIPMapper;

    public void saveWeiXinServerIP(WeiXinServerIP weiXinServerIP) {
        weiXinServerIPMapper.insert(weiXinServerIP);
    }

    public void updateWeiXinServerIP(WeiXinServerIP weiXinServerIP) {
        weiXinServerIPMapper.updateByPrimaryKey(weiXinServerIP);
    }

    public WeiXinServerIP findWeiXinServerIPById(int ipId) {

        return weiXinServerIPMapper.selectByPrimaryKey(ipId);
    }

    public void deleteWeiXinServerIP(WeiXinServerIP weiXinServerIP) {
        weiXinServerIPMapper.deleteByPrimaryKey(weiXinServerIP.getIpId());
    }
}
